//
//  GMSmUtils.h
//  iosTestDemo
//
//  Created by 证联 on 2022/7/1. 国密加密
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface GMSmUtils : NSObject

/// sm2 加密
/// @param key key 
/// @param pubKey 公钥
+(nullable NSString *)sm2Encrypt:(NSString *)key publicKey:(NSString *)pubKey;

/// Description  sm2 解密
/// @param sm4Key <#sm4Key description#>
/// @param prikey 私钥
+(nullable NSString *)sm2Decrypt:(NSString *)sm4Key privateKey:(NSString *) prikey;

/// <#Description#> sm2 加签
/// @param dic 公参数据
/// @param prikey 私钥
/// @param key 加签 key
+(nullable NSString *)sm2Sign:(NSDictionary *)dic privateKey:(NSString *) prikey key:(NSString *) key;

/// <#Description#>加签解签: 公参按照顺序
/// @param dic 公参 数据
+ (nullable NSString *)stingToJson:(NSDictionary *)dic;


/// <#Description#> sm2 验签
/// @param jsonData后端返回数据
/// @param pubKey 公钥
+(BOOL)sm2Verify:(NSDictionary *)jsonData publicKey:(NSString *)pubKey key:(NSString *) key;
@end

NS_ASSUME_NONNULL_END
